kdd3_dataset_list

for i_dataset = 8%1:length(all_dataset_names)
    
    dataset_name = all_dataset_names{i_dataset}
    
    n_fold = 10;
    for i_fold = 1:n_fold
        fid = fopen(['dag.txt.', dataset_name, '_', num2str(i_fold), '.txt']);
        
        tline = fgetl(fid);
        num_node = str2double(tline);
        dag = zeros(num_node, num_node);
        
        tline = fgetl(fid);
        while ischar(tline)
            array_line = str2num(tline);
            
            node_i = array_line(1) + 1;
            num_parent_i = array_line(2);
            if num_parent_i >= 1
                parent_i = array_line(3:end) + 1;
                dag(parent_i, node_i) = 1;
            end
            
            tline = fgetl(fid);
        end
        
        fclose(fid);
        
        flag = is_dag(dag)
        if flag
            save(['dag_', dataset_name, '_', num2str(i_fold)], 'dag')
        end
    end
    
end
